<?php

namespace App\Http\Requests\Admin\Ad;

use App\Http\Requests\Request;

class AdPositionRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * 验证规则
     *
     * @return array
     */
    public function rules()
    {
        return [
            'position_key' => 'required|unique:ad_position|max:30',
            'position_name' => 'required|max:50',
        ];
    }

    /**
     * 验证信息
     * @return array
     */

    public function messages()
    {
        return [
            'position_key.required' => '请填写广告位置标识',
            'position_key.unique'  => '广告位置标识已存在',
            'position_key.max'  => '广告位置标识必须小于30字符',

            'position_name.required' => '请填写广告位置名称',
//            'position_name.unique'  => '广告位置名称已存在',
            'position_name.max'  => '广告位置名称必须小于50字符',

        ];
    }

}
